]> Creatis software - crea.git/blob - appli/creaNewProject/CMakeLists.txt
3e540247505a17f360dcadc27b4776f94f5e118f
[crea.git] / appli / creaNewProject / CMakeLists.txt
1
2 #============================================================================
3 # Builds and install the executable creaNewProject
4
5 SET(EXE_NAME creaNewProject)
6 SET(${EXE_NAME}_SOURCES creaNewProject.cpp)
7 SET(${EXE_NAME}_HAS_GUI TRUE)
8 SET(${EXE_NAME}_CONSOLE FALSE)
9 SET(${EXE_NAME}_LINK_LIBRARIES crea)
10
11 CREA_ADD_EXECUTABLE( ${EXE_NAME} )
12 #============================================================================
13
14
15 #============================================================================
16 # Installs creaNewProject.bat/.sh  
17 # used to creates the file architecture for a new project
18 # and configures/installs the empty project structure used by creaNewProject
19 SET(INPUT_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/NewProject)
20
21 IF(WIN32)
22
23   # Build tree 
24   CONFIGURE_FILE(
25     ${CMAKE_CURRENT_SOURCE_DIR}/xcopy.exe
26     ${EXECUTABLE_OUTPUT_PATH}/Debug/xcopy.exe
27     COPYONLY 
28     )
29   CONFIGURE_FILE(
30     ${CMAKE_CURRENT_SOURCE_DIR}/creaNewProject.bat.in
31     ${EXECUTABLE_OUTPUT_PATH}/Debug/creaNewProject.bat
32     @ONLY IMMEDIATE
33     )
34          
35   CONFIGURE_FILE(
36     ${CMAKE_CURRENT_SOURCE_DIR}/NewProject/lib/template_lib/creaSystem.h.in
37     ${EXECUTABLE_OUTPUT_PATH}/lib/template_lib/${PROJECT_NAME}System.h
38     @ONLY IMMEDIATE
39     )
40       
41   CREA_MKDIR(${EXECUTABLE_OUTPUT_PATH}/Debug/creaNewProject_data)
42   CREA_CPDIR(${INPUT_PROJECT_DIR} ${EXECUTABLE_OUTPUT_PATH}/Debug/creaNewProject_data )
43   
44
45   CONFIGURE_FILE(
46     ${CMAKE_CURRENT_SOURCE_DIR}/xcopy.exe
47     ${EXECUTABLE_OUTPUT_PATH}/Release/xcopy.exe
48     COPYONLY 
49     )
50   CONFIGURE_FILE(
51     ${CMAKE_CURRENT_SOURCE_DIR}/creaNewProject.bat.in
52     ${EXECUTABLE_OUTPUT_PATH}/Release/creaNewProject.bat
53     @ONLY IMMEDIATE
54     )
55   CREA_MKDIR(${EXECUTABLE_OUTPUT_PATH}/Release/creaNewProject_data)
56   CREA_CPDIR(${INPUT_PROJECT_DIR} ${EXECUTABLE_OUTPUT_PATH}/Release/creaNewProject_data )
57   
58   
59   # install tree
60   INSTALL(
61     PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/Debug/xcopy.exe
62     DESTINATION bin
63     )
64   INSTALL(
65     PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/Debug/creaNewProject.bat
66     DESTINATION bin
67     )
68   INSTALL( 
69     DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/Debug/creaNewProject_data
70     DESTINATION bin
71     )  
72   
73 ELSE(WIN32)
74
75 # ======================= LINUX =======================
76
77   # Build tree 
78   CONFIGURE_FILE(
79     ${CMAKE_CURRENT_SOURCE_DIR}/creaNewProject.sh.in
80     ${EXECUTABLE_OUTPUT_PATH}/creaNewProject.sh
81     @ONLY IMMEDIATE
82     )
83   
84  # CONFIGURE_FILE(
85  #   ${CMAKE_CURRENT_SOURCE_DIR}/NewProject/lib/template_lib/creaSystem.h.in
86  #   ${EXECUTABLE_OUTPUT_PATH}/NewProject/lib/template_lib/${PROJECT_NAME}System.h
87  #   ${CMAKE_CURRENT_SOURCE_DIR}/NewProject/lib/template_lib/${PROJECT_NAME}System.h
88  #   @ONLY IMMEDIATE
89  #   )
90
91   CREA_MKDIR(${EXECUTABLE_OUTPUT_PATH}/share/creaNewProject)
92   CREA_CPDIR(${INPUT_PROJECT_DIR} ${EXECUTABLE_OUTPUT_PATH}/share/creaNewProject)
93
94   # Install tree
95   INSTALL(
96     FILES ${EXECUTABLE_OUTPUT_PATH}/creaNewProject.sh
97     DESTINATION bin
98     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
99     )
100
101   INSTALL(
102     DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/share/creaNewProject
103     DESTINATION share
104     )
105   
106 ENDIF(WIN32)
107
108
109
110