File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,15 @@ if (BUILD_EXAMPLES)
524524endif  (BUILD_EXAMPLES)
525525
526526if  (BUILD_CTL)
527+     if  (CMAKE_CROSSCOMPILING )
528+         find_program (HOST_DROGON_CTL _drogon_ctl)
529+         if  (NOT  HOST_DROGON_CTL)
530+             message (FATAL_ERROR "_drogon_ctl not found on host system" )
531+         endif ()
532+         set (DROGON_CTL "${HOST_DROGON_CTL} " )
533+     else  (CMAKE_CROSSCOMPILING )
534+         set (DROGON_CTL "$<TARGET_FILE:_drogon_ctl>" )
535+     endif  (CMAKE_CROSSCOMPILING )
527536    add_subdirectory (drogon_ctl)
528537endif  (BUILD_CTL)
529538
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ foreach(cspFile ${SCP_LIST})
4343  get_filename_component (classname ${cspFile}  NAME_WE )
4444  message (STATUS  "view classname:"  ${classname} )
4545  add_custom_command (OUTPUT  ${classname} .h ${classname} .cc
46-                      COMMAND  $<TARGET_FILE:_drogon_ctl> 
46+                      COMMAND  ${DROGON_CTL}  
4747                             ARGS
4848                             create
4949                             view
@@ -63,6 +63,7 @@ if(APPLE)
6363  target_link_libraries (drogon_ctl PRIVATE  resolv)
6464endif ()
6565message (STATUS  "bin:"  ${INSTALL_BIN_DIR} )
66+ install (TARGETS _drogon_ctl RUNTIME DESTINATION  ${INSTALL_BIN_DIR} )
6667install (TARGETS drogon_ctl RUNTIME DESTINATION  ${INSTALL_BIN_DIR} )
6768if (WIN32 )
6869  set (CTL_FILE $<TARGET_FILE:drogon_ctl>)
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ set(example_targets
5050    async_stream
5151    cors)
5252
53+ foreach (target  ${example_targets} )
54+     set_target_properties (${target}  PROPERTIES
55+         RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR} /bin)
56+ endforeach ()
57+ 
58+ install (TARGETS ${example_targets} 
59+     RUNTIME DESTINATION  ${INSTALL_BIN_DIR} )
60+ 
5361# Add warnings for our example targets--some warnings (such as -Wunused-parameter) only appear 
5462# when the templated functions are instantiated at their point of use. 
5563if (NOT  ${CMAKE_PLATFORM_NAME}  STREQUAL  "Windows"  AND  CMAKE_CXX_COMPILER_ID MATCHES  GNU)
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments